package com.zbs.framework.common.utils;

import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Getter
@Setter
public class PageData<T> {
    private List<T> list;
    private Long total;

    public PageData(List<T> list, Long total) {
        this.list = list;
        this.total = total;
    }

    public PageData(IPage<T> page) {
        this.list = page.getRecords();
        this.total = page.getTotal();
    }

    public PageData() {
        this.list = null;
        this.total = 0L;
    }
}
